package org.kaka.controller;

import org.kaka.dto.ChapterDto;
import org.kaka.po.ChapterPo;
import org.kaka.service.impl.ChapterServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/chapter")
public class ChapterController extends BaseController{
    @Autowired
    private ChapterServiceImpl chapterService;

    @PostMapping("/list")
    public Object list(@RequestBody ChapterPo chapterDto){
        return success(chapterService.list(chapterDto));
    }

    @GetMapping("/delete")
    public Object delete(Long id){
        chapterService.delete(id);
        return success("删除成功");
    }
}
